package com.my.study.collections;

import lombok.extern.slf4j.Slf4j;
import org.junit.Test;

import java.util.*;

/**
 * @author: yidujun
 * @create: 2021/03/16 16:54
 */
@Slf4j
public class UnSafeMap {

    private final Map<String, String> TEST = new HashMap<>();

    @Test
    public void test01() {
        String test = TEST.computeIfAbsent("test", s -> "33");
        System.out.println(test);

    }
    
    
    @Test
    public void testSet() {
        LinkedHashSet<String> linkedHashSet = new LinkedHashSet<>(4);
        
        linkedHashSet.add("1");
        linkedHashSet.add("2");
        linkedHashSet.add("3");


        System.out.println(linkedHashSet);
    }
    
    @Test
    public void testHash() {
        int n = 8;
        System.out.println((n -1) & 2147483647);
        
    }
    
    
    @Test
    public void testList() {
        List<String> list = new ArrayList<>(4);
        
        
        
        
        
    }

}
